package com.bdweb.dao;

import com.bdweb.model.USER;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserDao {
    @Select("select * from bd_user")
    List<USER> findAll();
    @Select("select * from bd_user where username=#{username} and password=#{password}")
    USER findByNameAndPwd(@Param("username") String username, @Param("password") String password);
    @Insert("insert into bd_user values(#{id}, #{username}, #{password})")
    Integer addByUser(USER user);
    @Delete("delete from bd_user where id=#{id}")
    Integer deleteUserById(Integer id);
    @Update("update bd_user set username=#{username}, password=#{password} where id=#{id}")
    Integer updateNameAndPwdById(@Param("id") Integer id, @Param("username") String name, @Param("password") String pwd);



}